extends ../layout

block content
  .container
    .row
      .col-md-7
        if movie
          embed(src=movie.flash, allowFullScreen="true", quality="high", width="600", height="500", align="middle", type="application/x-shockwave-flash")
      .col-md-5
        dl.dl-horizontal
          dt 分类
          dd= category.name
          dt 电影名字
          dd= movie.title
          dt 导演
          dd= movie.director
          dt 国家
          dd= movie.country
          dt 语言
          dd= movie.language
          dt 上映年份
          dd= movie.year
          dt 简介
          dd=movie.summary
    each comment in comments
      .row
        .col-md-7
          br
          .pull-left
            a.comment(href="#comments", data-cid=comment._id, data-tid=comment.from._id)
              span.text-primary.glyphicon.glyphicon-user(style="font-size:48px")
              //img.img-circle(src="http://delucia.cn/wp-content/uploads/2017/07/cropped-IMG_20170612_222926-1.jpg", alt="avatar",width="48",height="48")
            .bg-info.pull-right
          .pull-left(style="width:85%;height:100%;padding:5px 10px;font-size:12px;")
            h6.media-heading #{comment.from.name}
            p #{comment.content}
            if comment.reply && comment.reply.length > 0
              each reply in comment.reply
                .media
                  .pull-left
                    a.comment(href="#comments", data-cid=comment._id, data-tid=reply.from._id)
                      span.text-muted.glyphicon.glyphicon-user(style="font-size:24px")
                    .bg-info.pull-right
                  .pull-left(style="width:85%;height:100%;padding:5px 10px;font-size:12px;")
                    .media-body
                      h6.media-heading
                        | #{reply.from.name}
                        span.text-info &nbsp;回复&nbsp;
                        | #{reply.to.name} :
                      p #{reply.content}
          br
    .row
      .col-md-7
        br
        #comments
          form#commentForm(action="/user/comment", method="POST")
            input(type="hidden", name="comment[movie]", value=movie._id)
            if user
              input(type="hidden", name="comment[from]", value=user._id)
            .form-group
              textarea.form-control(name="comment[content]", cols="30", rows="3")
            if user
              button.btn.btn-primary.pull-right(type="submit") 提交评论
            else
              a.navbar-link(href="#", data-toggle="modal", data-target="#signinModal") 登录后评论
        br
        br
        br
  script(src="/js/detail.js")
